﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeanLib.SeanCache
{
    public interface ICache
    {
        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>            
        object GetCache(string key);

        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <returns></returns>
        T GetCache<T>(string key);

        /// <summary>
        /// 写入缓存
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        /// <param name="expire">失效时长 秒</param>
        void SetCache(string key, object value, int expire = 300);
    }
}
